/**
 * 
 */
package org.swing.utility.system.exception;

import java.lang.reflect.InvocationTargetException;

/**
 * @author lqnhu
 *
 */
public class Exceptions {
	public static RuntimeException rethrow(Throwable t) {
		while (t instanceof InvocationTargetException)
			t = ((InvocationTargetException) t).getTargetException();
		if (t instanceof RuntimeException)
			throw (RuntimeException) t;
		if (t instanceof Error)
			throw (Error) t;
		throw new RuntimeException(t);
	}
}
